package FIT::t::Runner;

use FIT::Test 'FIT::Runner';
use FIT::Document::Parser::Twig;
use aliased 'FIT::t::Fixture::Mock';

sub run_fixtures: Test(7) {
    Mock->clear_Called;
    io('tmp')->mkpath;
    io('tmp/in.html')->write('<html><table><tr><td>FIT.t.Mock</td></tr></table></html>');
    my $iut = IUT->new(
        options => {
            in  => "tmp/in.html",
            out => "tmp/out.html",
        },
    );
    my $exit_code = $iut->run;
    is $exit_code, 0, 'no error exit code';
    is $iut->context->tally->Right, 0, 'Right=0';
    ok Mock->Called('do_tables'), 'do_tables called';
    is $iut->in_file, 'tmp/in.html', 'in_file';
    is $iut->out_file, 'tmp/out.html', 'out_file';
    is $iut->in_dir, 'tmp', 'in_dir';
    is $iut->out_dir, 'tmp', 'out_dir';
    io('tmp')->rmtree;
}
